package com.lanou.service.impl;

import com.lanou.entity.TbItemDesc;
import com.lanou.mapper.TbItemDescMapper;
import com.lanou.service.ItemDescService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by QuChao on 2018/11/9
 */
@Service
public class ItemDescServiceImpl implements ItemDescService {
    @Autowired
    private TbItemDescMapper tbItemDescMapper;

    @Override
    public Map<String, Object> findByItemId(Long id) {
        TbItemDesc tbItemDesc = tbItemDescMapper.selectByPrimaryKey(id);
        Map<String, Object> map = new HashMap<>();
        if (tbItemDesc != null) {
            map.put("status", 200);
            map.put("data", tbItemDesc);
        } else {
            map.put("status", 400);
        }
        return map;
    }
}
